﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Counter {
    class Program {
        static void Main(string[] args) {

           int line1 = Count("../../../../Src/TealCompiler/mcs/");

           int line2 = Count("../../../mcs/");

           Console.WriteLine("还剩：{0:0.00}%", line1 * 100d / line2);

            Console.Read();

        }

        static int Count(string dirs) {

            int fileCount = 0;
            int line = 0;
            foreach (var file in Directory.GetFiles(dirs, "*.cs", SearchOption.TopDirectoryOnly)) {
                fileCount++;
                foreach (var item in File.ReadLines(file)) {
                    line++;
                }
            }


            Console.WriteLine("{2}\nfile: {0}, line: {1}", fileCount, line, dirs);

            return line;

        }
    }
}
